<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="stylesheet" href="../../css/style.css">
    <link rel="stylesheet" href="../../css/deliver.css">
    <title>物流公司</title>
</head>
<body>
        <div class="configNav"></div>

    <!-- content -->
    <div class="container-fluid">
        <div class="row">
            <!-- left -->
            <div class="col-md-2">
                <div class="list-group">
                    <a href="order_index.html" class="list-group-item ">交易订单</a>
                    <a href="deliver_index.html" class="list-group-item ">发货</a>
                    <a href="address.html" class="list-group-item ">发货设置</a>
                    <a href="evaluate_admin.html" class="list-group-item ">评价管理</a>
                </div>
            </div>
            <!-- right -->
            <div class="col-md-10">
                <ol class="breadcrumb">
                    <li><a href="">商家管理中心</a></li>
                    <li><a href="">订单物流</a></li>
                    <li class="active"><a href="">发货</a></li>
                </ol>
              <div class="mainBox">

              </div>
            </div>
        </div>
    </div>

    <script src="../../js/jquery.min.js" charset="utf-8"></script>
    <script src="../../js/bootstrap.min.js" charset="utf-8"></script>
    <script src="../../plugin/layer/layer.js" charset="utf-8"></script>
    <script src="../../plugin/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js" charset="utf-8"></script>
    <script src="../../plugin/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js" charset="utf-8"></script>
    <script src="../../plugin/wangEditor/release/wangEditor.min.js" charset="utf-8"></script>
    <script src="../../js/nav.js" charset="utf-8"></script>
    <script src="../../js/common.js" charset="utf-8"></script>
    <script src="../../js/bootstrap-paginator.js" charset="utf-8"></script>
    <script src="../../js/ajax.js" charset="utf-8"></script>
    <script>

        $(document).ready(function(){
            getOrderExpress();
            getExpress()
        })
        var orderDetailId=window.location.href.split("=")[1];//订单id
        //渲染数据
        function getOrderExpress(){
            var pageUrls =  cncbk_common_tools.serverURL + '/business/order/getOrderExpress';
            data={ 'orderDetailId':orderDetailId}
            var func = function(res){
                $('.mainBox').empty();
                var html='';
                html+='<table class="table table-bordered">'+
                '<tbody>'+
                '<tr>'+
                '<td class="col-md-7">'+
                '<div class="details">'+
                '<h6>物流详情</h6>'+
                '<hr>'+
                '<div class="buydetails">'+
                '<ul>'+
                '<li>收货信息：<span>'+res.data.name+'</span><span>'+res.data.phone+'</span><span>'+res.data.province+res.data.city+res.data.country+res.data.town+res.data.address+'</span></li>'+
                '<li>买家留言：<span></span></li>'+
                '<li>发货信息：<span>'+res.data.storeSellerName+'</span><span>'+res.data.storeTelphone+'</span><span>'+res.data.storeAreaInfo+res.data.storeAddress+'</span></li>'+
                '</ul>'+
                '</div>'+
                '<br>'+
                '<div class="logisticsDynamic">'+
                '<ul class="nav nav-tabs" role="tablist">'+
                '<li class="chose active" role="tab" ><a href="#home" data-toggle="tab">物流动态</a></li>'+
                '</ul>'+
                '<div class="tab-content">'+
                '<div  class="tab-pane active" role="tabpanel"  id="home" >'+
                '<table class="table table-bordered">'+
                '<tbody>'+
                '<tr>'+
                '<td class="logisticeTime">'+
                '<ul class="repeatExpress">'+

                '</ul>'+
                '</td>'+
                '</tr>'+
                '</tbody>'+
                '</table>'+
                '</div>'+
                '</div>'+
                '</div>'+
                '</div>'+
                '</td>'+
                '<td class="col-md-4">'+
                '<div>'+
                '<h6>订单信息</h6>'+
                '<hr>'+
                '<ul class="goosinfo">'+
                '<li class="goodsimg"><img src="http://axyhpic.oss-cn-zhangjiakou.aliyuncs.com/'+res.data.goodsImage+'" alt=""></li>'+
                '<li ><a href="http://47.92.118.122/html/wytx/goods_particulars.html?id='+res.data.goodsId +'">'+res.data.goodsName+'</a><br>'+
                '<span>￥'+res.data.goodsPrice+'</span> * <span>'+res.data.goodsQuantity+'件</span>'+
                '</li>'+
                '</ul>'+
                '<hr>'+
                '<ul class="orderInfo">'+
                '<li >运费：<span class="goodsFreight">'+res.data.goodsFreight+'</span></li>'+
                '<li>订单总额：<span>￥'+res.data.goodsAmount+'</span></li>'+
                '<li>订单编号：<span>'+res.data.orderSn+'</span><span style="float:right;" class="more">更多<i class="glyphicon glyphicon-chevron-down"></i></span></li>'+
                '<div class="moreOrderInfo">'+
                '<ul>'+
                '<li>支付方式：<span>'+res.data.paymentCode+'</span><span>(付款单号：'+res.data.paySn+')</span></li>'+
                '<li>下单时间：<span>'+res.data.orderTime+'</span></li>'+
                '<li>付款时间：<span>'+res.data.payTime+'</span></li>'+
                '<li>发货时间：<span>'+res.data.expressTime+'</span></li>'+
                '</ul>'+
                '</div>'+
                '<li>物流单号：<span>'+res.data.expressTime+'</span><span style="float:right;"><a href="" >'+res.data.expressCompany+'</a></span></li>'+
                '</ul>'+
                '</div>'+
                '</td>'+
                '</tr>'+
                '</tbody>'+
                '</table>';

                $('.mainBox').append(html);
                //显示支付信息
                $('.more').mouseenter(function(){
                    $('.moreOrderInfo').show()
                }).mouseleave(function(){
                    $('.moreOrderInfo').hide()
                })
     
            }
            ajax(
                pageUrls,
                data,
                func,
                'post',
                'json'
            )
        }

          //获取物流动态
          function getExpress(){
            var pageUrls =  cncbk_common_tools.serverURL + '/business/express/getOrderExpress';
            data={ 'orderDetailId':orderDetailId}
            var funGetExpress = function(res){
                $('.repeatExpress').empty();
                var html='';
                if (res.data.count == 0 ) {
                    html += '<li>暂无物流动态</li>';
                    $('.repeatExpress').append(html);
                }else{
                    for (var k = 0; k < res.data.list.length; k++) {
                    html += '<li><time>'+res.data.list[k].msgTime+'</time><span>'+res.data.list[k].content+'</span></li>';
                    	$('.repeatExpress').append(html);
                    }
                    
                }
            }
            ajax(
                pageUrls,
                data,
                funGetExpress,
                'post',
                'json'
            )

        }

    </script>
</body>
</html>
